<template class="app-container1">
  <div class="app-container">
    <div class="tou">
      <div class="le">渤海大学数据可视化遥控器</div>

      <div class="button-group">
        <el-button class="icon-button" @click="ClosesubSend(a)" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/data1.png')" style="width: 26px;"></el-image>
            <span style="margin-top: 8px;">数据展示</span>
          </div>
        </el-button>
        <el-button class="icon-button" @click="callContact" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/data.png')" style="width: 30px;"></el-image>
            <span style="margin-top: 5px;">成果展示</span>
          </div>
        </el-button>

        <el-button class="icon-button" @click="Yearsend(5)" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/year.png')" style="width: 26px;"></el-image>
            <span style="margin-top: 8px;">年份展示</span>
          </div>
        </el-button>
        <el-button class="icon-button" @click="CollegeSend(6)" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/college.png')" style="width: 26px;"></el-image>
            <span style="margin-top: 8px;">学院展示</span>
          </div>
        </el-button>
      </div>
      <br>
      <div class="le">渤海大学成果可视化遥控器</div>
      <div class="button-group">
        <el-button class="icon-button" @click="ShouContact(b)" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/shou.png')" style="width: 30px;"></el-image>
            <span style="margin-top: 5px;">成果首页</span>
          </div>
        </el-button>
        <el-button class="icon-button" @click="ZhuanSend(c)" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/zhuan.png')" style="width: 26px;"></el-image>
            <span style="margin-top: 8px;">转化公示</span>
          </div>
        </el-button>
        <el-button class="icon-button" @click="Liusend(d)" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/ping.png')" style="width: 26px;"></el-image>
            <span style="margin-top: 8px;">转化流程</span>
          </div>
        </el-button>
        <el-button class="icon-button" @click="zhuController" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/controller.png')" style="width: 26px;"></el-image>
            <span style="margin-top: 8px;">主遥控器</span>
          </div>
        </el-button>
      </div>
      <br>
      <div class="le">渤海大学流程可视化遥控器</div>

      <div class="button-group">
        <el-button class="icon-button" @click=" studentSubSend(21)" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/data1.png')" style="width: 26px;"></el-image>
            <span style="margin-top: 8px;">学生用户</span>
          </div>
        </el-button>
        <el-button class="icon-button" @click=" collegeSubSend(22)" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/data.png')" style="width: 30px;"></el-image>
            <span style="margin-top: 5px;">学院用户</span>
          </div>
        </el-button>

        <el-button class="icon-button" @click="enterpriseSubSend(23)" style="display: flex; flex-direction: column; align-items: center;">
          <div style="display: flex; flex-direction: column; align-items: center;">
            <el-image :src="require('@/assets/images/year.png')" style="width: 26px;"></el-image>
            <span style="margin-top: 8px;">企业用户</span>
          </div>
        </el-button>
      </div>
      <div class="u-title" v-show="showAchievement"></div>
      <div class="button-container" v-show="showAchievement">
        <div v-for="(item, index) in achievementList" :key="index">
          <el-button class="u-bu">
            <span >{{ index + 1 }}</span>
            <span >、{{ item.firstName }}</span>
          </el-button>
          <div class="button-row">
            <el-button type="primary" class="button-small" @click="subSend(item.userId)"><span class="te">查看</span></el-button>
            <el-button type="warning" class="button-small" @click="ClosesubSend(a)"><span class="te">关闭</span></el-button>
          </div>
        </div>
      </div>
      <div class="u-title" v-show="showAchievement1"></div>
      <div class="button-container" v-show="showAchievement1">
        <div v-for="(item, index) in YearmentList" :key="index">
          <el-button class="u-bu">
            <span >{{ item }}</span>
          </el-button>
          <div class="button-row">
            <el-button type="primary" class="button-small" @click="nianfen(item)"><span class="te">查看</span></el-button>
            <el-button type="warning" class="button-small" @click="ClosesubSend(a)"><span class="te">关闭</span></el-button>
          </div>
        </div>
      </div>
      <div class="u-title" v-show="showAchievement2"></div>
      <div class="button-container" v-show="showAchievement2">
        <div v-for="(item, index) in CollegementList" :key="index">
          <el-button class="college-bu">
            {{mapCollege(item.firstCollege)}}
          </el-button>
          <div class="college-row">
            <el-button type="primary" class="college-small" @click="xueyuan(item.firstCollege)"><span class="college-te">查看</span></el-button>
            <el-button type="warning" class="college-small" @click="ClosesubSend(a)"><span class="college-te">关闭</span></el-button>
          </div>
        </div>
      </div>

      <br>
      <div class="centered" v-show="showAchievement3" style="margin-top: 18px;">
        <el-button  class="my-button"  @click="shangyi(11)">上移</el-button>
        <el-button  class="my-button" @click="gunxia(10)">下移</el-button>
      </div>

      <br>
      <!--      <div class="centered" v-show="showAchievement3">
            <el-button type="danger" class="my-button" @click="weiqianyue('12')">未签约</el-button>
            <el-button type="success" class="my-button"  @click="yiqianyue('13')">已签约</el-button>
            </div>-->

      <div class="u-title" v-show="showAchievement3"></div>
      <div class="button-container" v-show="showAchievement3">
        <div v-for="(item, index) in achievementList" :key="index">
          <el-button class="u-bu">
            <span >{{ index + 1 }}</span>
            <span >、{{ item.firstName }}</span>
          </el-button>
          <div class="button-row">
            <el-button type="primary" class="button-small" @click="subSend1(item.id)"><span class="te">查看</span></el-button>
            <el-button type="warning" class="button-small" @click="ClosesubSend(24)"><span class="te">关闭</span></el-button>
          </div>
        </div>
      </div>
      <div class="centered" v-show="showAchievement4">
        <el-button  class="my-button"  @click="shangyi(11)">上移</el-button>
        <el-button  class="my-button" @click="gunxia(10)">下移</el-button>
      </div>
      <div class="centered" v-show="showAchievement5">
        <el-button  class="my-button"  @click="shangyi(11)">上移</el-button>
        <el-button  class="my-button" @click="gunxia(10)">下移</el-button>
      </div>
      <div class="centered" v-show="showAchievement6">
        <el-button  class="my-button"  @click="shangyi(11)">上移</el-button>
        <el-button  class="my-button" @click="gunxia(10)">下移</el-button>
      </div>
      <br v-show="showAchievement6">
      <br v-show="showAchievement6">
      <div class="centered"  v-show="showAchievement6">
        <el-button  class="my-button" @click="denglu(210)">成果发布</el-button>
        <el-button  class="my-button"  @click="denglu(211)">成果转化</el-button>
        <el-button  class="my-button" @click="denglu(212)">合同管理</el-button>
      </div>
      <br v-show="showAchievement6">
      <div class="centered" v-show="showAchievement6">
        <el-button  class="my-button" @click="denglu(213)">费用信息</el-button>
        <el-button  class="my-button" @click="denglu(214)">企业认证</el-button>
        <el-button  class="my-button"  @click="denglu(215)">个人认证</el-button>
      </div>
      <br v-show="showAchievement6">
      <div class="centered" v-show="showAchievement6">
        <el-button  class="my-button" @click="denglu(216)">成果公示</el-button>
        <el-button  class="my-button" @click="denglu(217)">信息导出</el-button>
      </div>
      <div class="centered" v-show="showAchievement7">
        <el-button  class="my-button"  @click="shangyi(11)">上移</el-button>
        <el-button  class="my-button" @click="gunxia(10)">下移</el-button>
      </div>
      <br v-show="showAchievement7">
      <br v-show="showAchievement7">
      <div class="centered" v-show="showAchievement7">
        <el-button  class="my-button" @click="denglu(210)">成果发布</el-button>
        <el-button  class="my-button" @click="denglu(218)" v-show="showAchievement9">发布申请</el-button>
        <el-button  class="my-button"  @click="denglu(211)">成果转化</el-button>
      </div>
      <br v-show="showAchievement7">
      <div class="centered" v-show="showAchievement7">
        <el-button  class="my-button" @click="denglu(212)">合同管理</el-button>
        <el-button  class="my-button" @click="denglu(213)">费用信息</el-button>
      </div>
      <div class="centered" v-show="showAchievement8">
        <el-button  class="my-button"  @click="shangyi(11)">上移</el-button>
        <el-button  class="my-button" @click="gunxia(10)">下移</el-button>
      </div>
      <br v-show="showAchievement8">
      <br v-show="showAchievement8">
      <div class="centered" v-show="showAchievement8">
        <el-button  class="my-button" @click="denglu(210)">成果发布</el-button>
        <el-button  class="my-button" @click="denglu(214)">企业认证</el-button>
      </div>
      <br><br>
    </div>
  </div>
</template>

<script>
import { ChalistAchievement,YearlistAchievement,CollegelistAchievement, getView,getClose} from "@/api/module/cjl/achievement";
import {getIpaddress} from "@/api/module/cjl/baseinfo"
export default {
  data() {
    return {
      a:'1',
      b:'2',
      c:'3',
      d:'4',
      ipAddress:"",
      user: '',
      // 以下websocket
      wsIsRun: false,
      // 定义ws对象
      webSocket: null,
      // ws连接次数
      wsNumber: 0,
      // ws请求链接（类似于ws后台地址）
      ws: '',
      // ws定时器
      wsTimer: null,
      // 以上websocket
      unreadMsgNums: 0,
      unreadMsgNumsShow: '',
      hasConnected: false,
      achievementList: [],
      YearmentList:[],
      CollegementList:[],
      showAchievement: false,
      showAchievement1: false,
      showAchievement2: false,
      showAchievement3: false,
      showAchievement4: false,
      showAchievement5: false,
      showAchievement6: false,
      showAchievement7: false,
      showAchievement8: false,
      showAchievement9: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userId: null,
        resultName: null,
        resultType: null,
        resultIntroduction: null,
        innovationPoint: null,
        competitionExperience: null,
        picturePath1: null,
        picturePath2: null,
        resultCategory: null,
        resultGrade: null,
        resultSource: null,
        resultBackground: null,
        resultMeaning: null,
        projectTime: null,
        technology: null,
        completionUnit: null,
        applyName: null,
        applyNumber: null,
        applyTime: null,
        auditState: null,
        auditTime: null,
        auditName: null,
        auditNumber: null,
        isShow: null,
        firstName: null,
        firstGrade: null,
        firstMajor: null,
        firstNumber: null,
        firstCollege: null,
        firstPhone: null,
        firstIdnumber: null,
        secondName: null,
        secondGrade: null,
        secondMajor: null,
        secondNumber: null,
        secondCollege: null,
        secondPhone: null,
        secondIdnumber: null,
        thirdName: null,
        thirdGrade: null,
        thirdMajor: null,
        thirdNumber: null,
        thirdCollege: null,
        thirdPhone: null,
        thirdIdnumber: null,
        fourthName: null,
        fourthGrade: null,
        fourthMajor: null,
        fourthNumber: null,
        fourthCollege: null,
        fourthPhone: null,
        fourthIdnumber: null,
        fifthName: null,
        fifthGrade: null,
        fifthMajor: null,
        fifthNumber: null,
        fifthCollege: null,
        fifthPhone: null,
        fifthIdnumber: null,
        advisorName1: null,
        advisorTitl1: null,
        advisorMajor1: null,
        advisorNumber1: null,
        advisorName2: null,
        advisorTitl2: null,
        advisorMajor2: null,
        advisorNumber2: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null,
        signingStatus: null,
        cooperativeObject: null,
        resultYear: null,
        sixthName: null,
        sixthGrade: null,
        sixthMajor: null,
        sixthNumber: null,
        sixthCollege: null,
        sixthPhone: null,
        sixthIdnumber: null,
        seventhName: null,
        seventhGrade: null,
        seventhMajor: null,
        seventhNumber: null,
        seventhCollege: null,
        seventhPhone: null,
        seventhIdnumber: null,
        eighthName: null,
        eighthGrade: null,
        eighthMajor: null,
        eighthNumber: null,
        eighthCollege: null,
        eighthPhone: null,
        eighthIdnumber: null,
        ninthName: null,
        ninthGrade: null,
        ninthMajor: null,
        ninthNumber: null,
        ninthCollege: null,
        ninthPhone: null,
        ninthIdnumber: null,

      },
    }

  },
  created() {
    this.wsIsRun = true
    this.wsNumber = 1
    this.getIp();
    // this.wsInit();
    // this.getList()
    // this.getList1()
    // this.getList2()
  },
  methods: {
    weiqianyue(){
      this.webSocket.send(12);
    },
    yiqianyue(){
      this.webSocket.send(13);
    },
    gunxia(e){
      this.webSocket.send(10);
    },
    denglu(a){
      if(a==210||a==218){
        this.showAchievement9=true;
      }else{
        this.showAchievement9=false;
      }
      this.webSocket.send(a);
    },
    shangyi(){
      this.webSocket.send(11);
    },
    nianfen(item){
      this.webSocket.send(item);
    },
    xueyuan(firstCollege){
      let fi=3+firstCollege;
      this.webSocket.send(fi);
    },
    getIp() {
      getIpaddress().then(res=>{
        this.ipAddress=res;
        this.wsInit();
        this.getList()
        this.getList1()
        this.getList2()
      })
    },
    mapCollege(collegeCode) {
      switch (collegeCode) {
        case '001':
          return '文学院';
        case '002':
          return '马克思主义学院';
        case '003':
          return '法学院';
        case '004':
          return '历史文化学院';
        case '005':
          return '物理科学与技术学院';
        case '006':
          return '数学科学学院';
        case '007':
          return '化学与材料工程学院';
        case '008':
          return '食品科学与工程学院';
        case '009':
          return '信息科学与技术学院';
        case '010':
          return '控制科学与工程学院';
        case '011':
          return '经济学院';
        case '012':
          return '管理学院';
        case '013':
          return '旅游学院';
        case '014':
          return '外国语学院';
        case '015':
          return '教育科学学院';
        case '016':
          return '体育学院';
        case '017':
          return '美术学院';
        case '018':
          return '音乐学院';
        case '019':
          return '新闻与传播学院';
        case '020':
          return '航运学院';
        case '021':
          return '大学外语教研部';
        case '022':
          return '师范学院';
        case '023':
          return '创新创业学院';
        case '024':
          return '继续教育学院';
        case '025':
          return '附属高级中学';
        case '026':
          return '国际教育学院转化';
        default:
          return '';
      }
    },
    /** 查询成果信息 */
    getList() {
      this.loading = true;
      ChalistAchievement(this.queryParams).then(response => {
        this.achievementList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 查询成果信息 */
    getList1() {
      this.loading = true;
      YearlistAchievement(this.queryParams).then(response => {
        this.YearmentList = response.data;
        this.total = response.total;
        this.loading = false;
        this.YearmentList.sort(function(a, b) {
          return a - b;
        });

        console.log(this.YearmentList+"111")
      });
    },
    getList2() {
      this.loading = true;
      CollegelistAchievement(this.queryParams).then(response => {
        this.CollegementList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
      console.log(this.CollegementList+"111")
    },
    View(userId){
      /*getView(userId).then(res => {
        this.form=res.data
        console.log(this.form.resultName)
      });*/
      // this.
      this.$router.push({ path:"/view", query: {userId}});
    },
    Closen(){
      getClose().then(res => {
      });
    },
    showWelcomePage() {
      // 处理显示欢迎页的逻辑
    },
    showCollegeIntro() {
      // 处理显示学院介绍的逻辑
    },
    callContact() {
      this.showAchievement1 = false;
      this.showAchievement2 = false;
      this.showAchievement3 = false;
      this.showAchievement4 = false;
      this.showAchievement7=false;
      this.showAchievement6=false;
      this.showAchievement8=false;
      this.showAchievement = true;
    },
    Yearsend(){
      this.showAchievement = false;
      this.showAchievement2 = false;
      this.showAchievement3 = false;
      this.showAchievement4 = false;
      this.showAchievement5 = false;
      this.showAchievement7=false;
      this.showAchievement6=false;
      this.showAchievement8=false;
      this.showAchievement1 = true;
      /* this.webSocket.send(5);*/
    },
    CollegeSend(){
      this.showAchievement1 = false;
      this.showAchievement = false;
      this.showAchievement3 = false;
      this.showAchievement4 = false;
      this.showAchievement5 = false;
      this.showAchievement7=false;
      this.showAchievement6=false;
      this.showAchievement8=false;
      this.showAchievement2 = true;
      /*this.webSocket.send(6);*/
    },
    ShouContact(b) {
      this.showAchievement = false;
      this.showAchievement1 = false;
      this.showAchievement2 = false;
      this.showAchievement4 = false;
      this.showAchievement5 = false;
      this.showAchievement7=false;
      this.showAchievement6=false;
      this.showAchievement8=false;
      this.showAchievement3 = true;
      this.webSocket.send(b);
    },
    ZhuanSend(c){
      this.showAchievement = false;
      this.showAchievement1 = false;
      this.showAchievement2 = false;
      this.showAchievement3 = false;
      this.showAchievement5 = false;
      this.showAchievement7=false;
      this.showAchievement6=false;
      this.showAchievement8=false;
      this.showAchievement4 = true;
      this.webSocket.send(c);


    },
    Liusend(d){
      this.showAchievement = false;
      this.showAchievement1 = false;
      this.showAchievement2 = false;
      this.showAchievement3 = false;
      this.showAchievement4 = false;
      this.showAchievement7=false;
      this.showAchievement6=false;
      this.showAchievement8=false;
      this.showAchievement5 = true;
      this.webSocket.send(d);
    },
    zhuController(){
      /*this.showAchievement = false;
      this.showAchievement1 = false;
      this.showAchievement2 = false;
      this.showAchievement3 = false;
      this.showAchievement4 = false;
      this.showAchievement5 = !this.showAchievement5;*/
      /* this.$router.go("http://cxcygl.bhu.edu.cn/mapi/inside?vid=control")*/
      window.location.href="http://cxcygl.bhu.edu.cn/mapi/inside?vid=control";
    },
    /**
     * 初始化ws
     */
    wsInit() {
      // console.log("userName: " + this.$store.state.user.ipp)
      console.log("user: " + this.$store.state.constip.ipp)
      console.log("user: " + this.ipAddress)
      // const wsuri = 'ws://' + '210.47.178.218' + ':8080/library/wsService/' + this.$store.state.user.name
      this.getConfigKey("sys.account.ip").then(response => {
        this.sysipp = response.msg;
      });
      console.log("sysipp: " + this.sysipp)
      const wsuri = 'ws://' + this.sysipp + '/library/wsService/' +
        this.$store.state.constip.ipp + "_" + Math.floor(Math.random() * (99999 - 10000) + 10000)
      console.log("wsuri: " + wsuri)
      this.ws = wsuri
      if (!this.wsIsRun)
        return
      // 销毁ws
      this.wsDestroy()
      // 初始化ws
      this.webSocket = new WebSocket(this.ws)
      // ws连接建立时触发
      this.webSocket.addEventListener('open', this.wsOpenHanler)
      // ws服务端给客户端推送消息
      this.webSocket.addEventListener('message', this.wsMessageHanler)
      // ws通信发生错误时触发
      this.webSocket.addEventListener('error', this.wsErrorHanler)
      // ws关闭时触发
      this.webSocket.addEventListener('close', this.wsCloseHanler)

      clearInterval(this.wsTimer);
    },
    subSend(userId) {

      //获取msg的value
      // var msg = document.getElementById("msg").value;

      this.webSocket.send(userId);

      // ws服务端给客户端推送消息

      // document.getElementById("msg").value="";
    },
    subSend1(userId) {

      //获取msg的value
      // var msg = document.getElementById("msg").value;

      this.webSocket.send(userId+500);

      // ws服务端给客户端推送消息

      // document.getElementById("msg").value="";
    },


    wsOpenHanler(event) {
      console.log('ws建立连接成功')
    },
    wsMessageHanler(e) {
      console.log('wsMessageHanler')
      console.log(e)
      //Cookies.set('unreadNums', '6')

      this.openMsg(e)
      //const redata = JSON.parse(e.data)
      //console.log(redata)

    },
    /**
     * ws通信发生错误
     */
    wsErrorHanler(event) {
      console.log(event, '通信发生错误')
      console.log("第" + this.wsNumber + "次断线重连(5次未连接将自动断开)")
      this.wsNumber++
      if (this.wsNumber < 6) this.wsInit();
      //this.wsInit()
    },
    /**
     * ws关闭
     */
    wsCloseHanler(event) {
      console.log(event, 'ws关闭')
      console.log("websocket连接超时，已自动断开")
      //this.wsInit()
    },
    /**
     * 销毁ws
     */
    wsDestroy() {
      console.log("hello world")
      if (this.webSocket !== null) {
        this.webSocket.removeEventListener('open', this.wsOpenHanler)
        this.webSocket.removeEventListener('message', this.wsMessageHanler)
        this.webSocket.removeEventListener('error', this.wsErrorHanler)
        this.webSocket.removeEventListener('close', this.wsCloseHanler)
        this.webSocket.close()
        this.webSocket = null
        clearInterval(this.wsTimer)
        console.log("zoul111")
      } else {
        console.log("zoul")
      }
    },
    ClosesubSend(a){
      this.webSocket.send(a);
    },
    studentSubSend(a){
      this.showAchievement1 = false;
      this.showAchievement = false;
      this.showAchievement3 = false;
      this.showAchievement4 = false;
      this.showAchievement5 = false;
      this.showAchievement2 = false;
      this.showAchievement6=false;
      this.showAchievement8=false;
      this.showAchievement7=true;

      this.webSocket.send(a);
    },
    collegeSubSend(a){
      this.showAchievement1 = false;
      this.showAchievement = false;
      this.showAchievement3 = false;
      this.showAchievement4 = false;
      this.showAchievement5 = false;
      this.showAchievement2 = false;
      this.showAchievement7=false;
      this.showAchievement8=false;
      this.showAchievement6=true;
      this.webSocket.send(a);
    },
    enterpriseSubSend(a){
      this.showAchievement1 = false;
      this.showAchievement = false;
      this.showAchievement3 = false;
      this.showAchievement4 = false;
      this.showAchievement5 = false;
      this.showAchievement2 = false;
      this.showAchievement7=false;
      this.showAchievement6=false;
      this.showAchievement8=true;
      this.webSocket.send(a);
    },



    /**
     * 弹窗
     */
    openMsg(e) {
      // alert("1")
      const h = this.$createElement;
      if (e.data) {
        console.log(e.data)
        /*var dv = document.getElementById("dv");
        dv.innerHTML += e.data + " ";*/
        /*this.$router.push({path: "/"});*/

        var data = JSON.parse(e.data)
        var route = this.$router;
        var msgType = data.msgType;
        /*if (msgType == "push") {
          // 如果是推送的是一条消息
          this.unreadMsgNums++;
          if (this.unreadMsgNums > 99) {
            this.unreadMsgNumsShow = "99+";
          } else {
            this.unreadMsgNumsShow = String(this.unreadMsgNums);
          }

          this.$notify.info({
            title: data.msgTitle,
            message: data.msgContent,
            onClick() {
              console.log(route)
              route.push({path: "/library/yyg/msg/list"});
            }
          });
        } else if (msgType == "unread") {
          // 如果推送的是未读消息数
          //Cookies.set('unreadNums', data.unreadNums);
          this.unreadMsgNums = Number(data.unreadNums);
          if (this.unreadMsgNums > 0) {
            this.unreadMsgNumsShow = String(this.unreadMsgNums);
            if (this.unreadMsgNums > 99) {
              this.unreadMsgNumsShow = "99+";
            }
            this.$notify.info({
              title: "消息提醒",
              //message: data.msgContent,
              message: "您当前有" + this.unreadMsgNumsShow + "条未读消息，点击此处查看",
              onClick() {
                console.log(route)
                route.push({path: "/library/yyg/msg/list"});
              }
            });
          }
        } else if (msgType == "read") {
          // 如果推送的是用户已读消息
          this.unreadMsgNums--;
          if (this.unreadMsgNums > 0 && this.unreadMsgNums <= 99) {
            this.unreadMsgNumsShow = String(this.unreadMsgNums);
          } else if (this.unreadMsgNums <= 0) {
            this.unreadMsgNumsShow = '';
          }
        }
*/
      }
    },
  },
};
</script>

<style scoped>
.app-container {
  background-color: #f5f5f5; /* 设置整体背景颜色为灰色 */
  height: 150%;
}
.tou {
  background-color: #f5f5f5; /* 微型灰 */
}
.centered {
  display: flex;
  justify-content: center;
}
.my-button {
  width: 100px; /* 设置自定义宽度 */
}
.le {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px; /* 标题与按钮组的间距 */

}
.u-title {
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  margin-top: 40px; /* 标题与顶部的间距 */
  margin-bottom: 20px; /* 标题与按钮组的间距 */
}
.u-bu {
  width: 100px;
  height: 30px;
  border: none;
}
.button-group {
  display: flex;
  justify-content: center;
}
.icon-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 80px;
  height: 80px;
}

.icon-button i {
  display: block;
}


/*成果库按钮样式*/
.button-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.button-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.button-row .button-small {
  margin-left: 0px;
  margin-right: 0px;
  width: 50px;
  height: 30px;
}
.button-row .button-small span.te {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%; /* 确保文字水平居中 */
  height: 100%; /* 确保文字垂直居中 */
}
/*成果库按钮样式*/

/* 学院按钮  */
.college-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.college-bu {
  width: 150px;
  height: 30px;
  border: none;
}
.college-row .college-small {
  margin-left: 0px;
  margin-right: 0px;
  width: 75px;
  height: 30px;
}
.college-row .college-small span.college-te {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%; /* 确保文字水平居中 */
  height: 100%; /* 确保文字垂直居中 */
}
/* 学院按钮  */
</style>
